package fr.fitec.qcmPlus.beans;

import java.io.Serializable;
import java.sql.Timestamp;

import fr.fitec.qcmPlus.constants.QcmConstants;

public class Questionnaire implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	 
	private int idQuestionnaire = QcmConstants.ID_INVALIDE;
	private String nom;
	private String description;
	private String statut;
	private Timestamp date_creation;
	private Timestamp date_maj;
	private Timestamp date_suppr;
	
	
	public Questionnaire(){
	}
	
	public Questionnaire(String name){
		this.nom	=	name;
	}

	public Questionnaire(int id, String name){
		this.idQuestionnaire	=	id;
		this.nom				=	name;
	}

	public Questionnaire(Questionnaire quest){
		this.idQuestionnaire	=	quest.idQuestionnaire;
		this.nom				=	quest.nom;
		this.description		=	quest.description;
		this.statut				=	quest.statut;
		this.date_creation		=	quest.date_creation;
		this.date_maj			=	quest.date_maj;
		this.date_suppr			=	quest.date_suppr;
	}

	public Timestamp getDate_maj() {
		return date_maj;
	}

	public void setDate_maj(Timestamp dateMaj) {
		date_maj = dateMaj;
	}

	public Timestamp getDate_suppr() {
		return date_suppr;
	}

	public void setDate_suppr(Timestamp dateSuppr) {
		date_suppr = dateSuppr;
	}

    public int getIdQuestionnaire() {
		return idQuestionnaire;
	}
	public void setIdQuestionnaire(int idQuestionnaire) {
		this.idQuestionnaire = idQuestionnaire;
	}
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getStatut() {
		return statut;
	}
	public void setStatut(String statut) {
		this.statut = statut;
	}

	public void setDate_creation(Timestamp date_creation) {
		this.date_creation = date_creation;
	}

	public Timestamp getDate_creation() {
		return date_creation;
	}
    @Override
    public String toString()
    {
        final StringBuilder sb = new StringBuilder();
        sb.append("id: "+this.getIdQuestionnaire()).append("\n");
        sb.append("nom: "+this.getNom()).append("\n");
        sb.append("description: "+this.getDescription()).append("\n");
        sb.append("statut: "+this.getStatut()).append("\n");
        sb.append("date creation: "+this.getDate_creation()).append("\n");
        sb.append("date maj: "+this.getDate_maj()).append("\n");
        sb.append("date suppr: "+this.getDate_suppr());

        return sb.toString();
    }
}
